Socket
Socket
Sign inDemoInstall

fragment-cache

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fragment-cache

A cache for managing namespaced sub-caches


Version published
Maintainers
1
Created

What is fragment-cache?

The fragment-cache package is a simple caching module that allows you to set and get fragments of data. It is particularly useful for storing parts of data that are expensive to generate, such as parts of web pages or results of complex calculations, so that they can be reused without needing to be recalculated.

What are fragment-cache's main functionalities?

Setting and getting cache entries

This feature allows you to store a value in the cache under a specific key and then retrieve that value using the key. It's useful for caching results of operations that are expensive to compute.

const FragmentCache = require('fragment-cache');
const cache = new FragmentCache();
cache.set('key', 'value');
const value = cache.get('key');

Checking if a cache key exists

This feature enables you to check if a specific key exists in the cache. It can be used to determine whether you need to generate a new value for the cache or if you can reuse an existing value.

const FragmentCache = require('fragment-cache');
const cache = new FragmentCache();
cache.set('key', 'value');
const exists = cache.has('key');

Other packages similar to fragment-cache

Keywords

FAQs

Package last updated on 03 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc